﻿<r:RibbonWindow x:Class="AdminMainUI.MainWindow"
        xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="554" Width="798" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" Icon="/Appfabric Administrator;component/Images/server.ico">
    <Grid Height="517">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="220*" />
            <ColumnDefinition Width="40*" />
            <ColumnDefinition Width="516*" />
        </Grid.ColumnDefinitions>

        <r:Ribbon Title="Appfabric Cluster Administrator 1.1.0" x:Name="ribbon" Grid.ColumnSpan="3" Height="152" VerticalAlignment="Top" Margin="0,-11,0,0">
            <r:Ribbon.ApplicationMenu>
                <r:RibbonApplicationMenu AuxiliaryPaneContent="">
                    <r:RibbonApplicationMenuItem Name="amiAbout" Header="About" ImageSource="Images\Icons\About-32.png" Click="amiAbout_Click"/>
                    <r:RibbonApplicationMenuItem Name="amiExit" Header="Exit" ImageSource="Images\Icons\Exit-32.png" Click="amiExit_Click"/>
                </r:RibbonApplicationMenu>
            </r:Ribbon.ApplicationMenu>

            <r:RibbonTab Header="Cluster">
                <r:RibbonGroup Name="Connect" Header="Connect">
                    <r:RibbonButton LargeImageSource="Images\Connect-32.png" Label="Manual Connect" Click="RibbonButton_Click" ToolTipTitle="Manual Connect" ToolTipDescription="Manually connect to an Appfabric cluster instance."></r:RibbonButton>
                </r:RibbonGroup>
                <r:RibbonGroup Name="rgClusterOperations" Header="Cluster Operations" Visibility="Hidden">
                    <r:RibbonButton Name="rbCcStart" LargeImageSource="Images\Start-32.png" Label="Start" Click="rbCcStart_Click" ToolTipTitle="Start Cache Cluster" ToolTipDescription="Starts the Caching Service on all cache hosts in the cluster. Lead hosts are started first."/>
                    <r:RibbonButton Name="rbCcStop" LargeImageSource="Images\Stop-32.png" Label="Stop" Click="rbCcStop_Click" ToolTipTitle="Stop Cache Cluster" ToolTipDescription="Stops the Caching Services on all cache hosts in the cluster."/>
                    <r:RibbonButton Name="rbCcRestart" LargeImageSource="Images\Restart-32.png" Label="Restart" Click="rbCcRestart_Click" ToolTipTitle="Restart Cache Cluster" ToolTipDescription="Restarts the Caching Service on all cache hosts in the cluster."/>
                </r:RibbonGroup>
                <r:RibbonGroup Name="rgClusterImport" Header="Import/Export" Visibility="Hidden">
                    <r:RibbonButton Name="rbCcExport" LargeImageSource="Images\Export-32.png" Label="Export Config" Click="rbCcExport_Click" ToolTipTitle="Export Cache Clutser Config" ToolTipDescription="Cluster configuration is exported to the given XML file, irrespective of the provider type."/>
                    <r:RibbonButton Name="rbCcImport" LargeImageSource="Images\Import-32.png" Label="Import Config" Click="rbCcImport_Click" ToolTipTitle="Import Cache Cluster Config" ToolTipDescription="The configuration from XML file is applied immediately and overwrites any previous configuration. Once applied, the configuration cannot be reverted."/>
                </r:RibbonGroup>
                <r:RibbonGroup Name="rgClusterAdvanced" Header="Advanced" Visibility="Hidden">
                    <r:RibbonButton Name="rbCcAccess" LargeImageSource="Images\Access-32.png" Label="Grant/Revoke Access" Click="rbCcAccess_Click" ToolTipTitle="Grant/Revoke Cluster Access" ToolTipDescription="The Windows account provided is added to the list of allowed clients present in cluster configuration. Removing prevents the account from connecting to the cache cluster as a client."/>
                    <r:RibbonButton Name="rbCcSecurity" Label="Security" ToolTipTitle="Set Cluster Security" LargeImageSource="Images\Security-32.png" ToolTipDescription="Modify the security settings used on servers on a cluster." Click="rbCcSecurity_Click"/>
                    <r:RibbonButton Name="rbCcGC" Label="Garbage Collect" Click="rbCcGC_Click" LargeImageSource="Images\GC-32.png" ToolTipTitle="Invoke Garbage Collection" ToolTipDescription="Used to initiate .NET garbage collection to reclaim unused memory. Note that this initiates garbage collection on all cache hosts in the cluster."/>
                </r:RibbonGroup>
            </r:RibbonTab>

            <r:RibbonTab Header="Hosts" Name="rtHosts" Visibility="Hidden">
                <r:RibbonGroup Name="rgHostOperations" Header="Host Operations">
                    <r:RibbonButton Name="rbChStart" LargeImageSource="Images\Start-32.png" Label="Start" Click="rbChStart_Click" ToolTipTitle="Start Cache Host" ToolTipDescription="Start the Caching Service on a specific cache host. It should be used in a cache cluster that is currently running. If the cache cluster is down, use the start cache cluster command instead."/>
                    <r:RibbonSplitButton Name="rbChStop" LargeImageSource="Images\Stop-32.png" Label="Stop" Click="rbChStop_Click" ToolTipTitle="Stop Cache Host" ToolTipDescription="Stops the specified cache host service.">
                        <r:RibbonSplitButton.Items>
                            <MenuItem Header="Graceful Stop" Name="rbnGracefulStop" Click="rbnGracefulStop_Click" ToolTip="A graceful shutdown moves cache items to other cache hosts before stopping the Caching Service. This avoids data loss and the requirement for cache clients to repopulate those items."/>
                        </r:RibbonSplitButton.Items> 
                    </r:RibbonSplitButton>
                    <r:RibbonSplitButton Name="rbChRestart" LargeImageSource="Images\Restart-32.png" Label="Restart" Click="rbChRestart_Click" ToolTipTitle="Restart Cache Host" ToolTipDescription="Restarts the Caching Service on the specified cache host.">
                        <r:RibbonSplitButton.Items>
                            <MenuItem Header="Graceful restart" Name="rbnGracefulRestart"  Click="rbnGracefulRestart_Click" ToolTip="A graceful shutdown moves cache items to other cache hosts before stopping the Caching Service. This avoids data loss and the requirement for cache clients to repopulate those items."/>
                        </r:RibbonSplitButton.Items>
                    </r:RibbonSplitButton>
                    <r:RibbonButton Name="rbChRefresh" LargeImageSource="Images\Refresh-32.png" Label="Refresh" Click="rbChRefresh_Click" ToolTipTitle="Refresh Cache Host" ToolTipDescription="Refreshes the list of cache hosts."/>
                    <r:RibbonButton Name="rbChConfig" Label="Host Configuration" LargeImageSource="Images\HostConfiguration-32.png" Click="rbChConfig_Click" ToolTipTitle="Cache Host Configuration" ToolTipDescription="Returns the configuration details of the specified Cache Host."/>
                </r:RibbonGroup>
            </r:RibbonTab>
            
            <r:RibbonTab Header="Cache" Name="rtCache" Visibility="Hidden">
                <r:RibbonGroup Name="rgCacheOperations" Header="Cache Operations">
                    <r:RibbonButton Name="rbCNew" LargeImageSource="Images\New-32.png" Label="New" Click="rbCNew_Click" ToolTipTitle="Create New Cache" ToolTipDescription="Creates a new named cache when the cluster is running. All values except for CacheName are optional."/>
                    <r:RibbonButton Name="rbCRemove" LargeImageSource="Images\Remove-32.png" Label="Remove" Click="rbCRemove_Click" ToolTipTitle="Remove Cache" ToolTipDescription="Removes the named cache."/>
                    <r:RibbonButton Name="rbCRefresh" LargeImageSource="Images\Refresh-32.png" Label="Refresh" Click="rbCRefresh_Click" ToolTipTitle="Refresh Cache" ToolTipDescription="Refreshes the cache list."/>
                    <r:RibbonButton Name="rbCStatistics" Label="Statistics" LargeImageSource="Images\Statistics-32.png" Click="rbCStatistics_Click" ToolTipTitle="Cache Statistics" ToolTipDescription="Shows statistics for a Cache."/>
                    <r:RibbonButton Name="rbCConfig" LargeImageSource="Images\Configuration-32.png" Label="Cache Configuration" Click="rbCConfig_Click" ToolTipTitle="Cache Configuration" ToolTipDescription="Shows the configuration details of the specified Cache."/> 
                </r:RibbonGroup>
            </r:RibbonTab>
        </r:Ribbon>
        <TreeView Height="168" HorizontalAlignment="Left" Name="trCache" Width="220" VerticalAlignment="Top" Margin="0,133,0,0">
                <TreeViewItem Header="Cache" Name="tviCache" LostFocus="tviCache_LostFocus" GotFocus="tviCache_GotFocus"/>
            </TreeView>
        <Canvas Grid.Column="1" Height="339" HorizontalAlignment="Left" Margin="0,137,0,0" Name="pnlCacheStatistics" VerticalAlignment="Top" Width="556" Visibility="Hidden" Grid.ColumnSpan="2">
            <Label Canvas.Left="36" Canvas.Top="6" Content="" Height="40" Name="lblCSHeader" FontSize="20" Width="514" FontWeight="SemiBold" />
            <Label Name="lblCacheName2" Content="Size :" Canvas.Left="36" Canvas.Top="62" />
            <Label Name="lblCacheName3" Content="Item Count :" Canvas.Left="36" Canvas.Top="94" />
<Label Name="lblCacheName4" Content="Region Count :" Canvas.Left="36" Canvas.Top="126" />
<Label Name="lblCacheName5" Content="Request Count :" Canvas.Left="296" Canvas.Top="62" />
<Label Name="lblCacheName6" Content="Read Request Count :" Canvas.Left="296" Canvas.Top="94" />
<Label Name="lblCacheName7" Content="Write Request Count :" Canvas.Left="296" Canvas.Top="126" />
<Label Name="lblCacheName8" Content="Miss Count: " Canvas.Left="296" Canvas.Top="158" />
<Label Name="lblCacheName9" Content="Incomimg Bandwidth: " Canvas.Left="36" Canvas.Top="158" />
<Label Name="lblCacheName10" Content="Outgoing Bandwidth: " Canvas.Left="36" Canvas.Top="190" />
            <Label Canvas.Left="194" Canvas.Top="62" Content="" Height="28" Name="lblSize" />
            <Label Canvas.Left="194" Canvas.Top="94" Content="" Height="28" Name="lblItemCount" />
            <Label Content="" Height="28" Name="lblRegionCount" Canvas.Left="194" Canvas.Top="126" />
            <Label Canvas.Left="194" Canvas.Top="158" Content="" Height="28" Name="lblInBandwidth" />
            <Label Canvas.Left="194" Canvas.Top="190" Content="" Height="28" Name="lblOutBandwidth" />
            <Label Canvas.Left="453" Canvas.Top="60" Content="" Height="28" Name="lblRequestCount" />
            <Label Canvas.Left="453" Canvas.Top="94" Content="" Height="28" Name="lblReadReqCount" />
            <Label Canvas.Left="453" Canvas.Top="126" Content="" Height="28" Name="lblWriteReqCount" />
            <Label Canvas.Left="453" Canvas.Top="158" Content="" Height="28" Name="lblMissCount" />
            <Label Canvas.Left="410" Canvas.Top="305" Content="" Height="28" Name="lblTimestamp" FontSize="9" FontStyle="Italic" FontWeight="ExtraBlack" />
            <Button Canvas.Left="244" Canvas.Top="281" Content="Close" Height="23" Name="btnClosePanel" Width="75" Click="btnClosePanel_Click"/>
        </Canvas>
        <TreeView Height="168" HorizontalAlignment="Left" Name="trHosts" Width="220" VerticalAlignment="Top" Margin="0,307,0,0">
            <TreeViewItem Header="Hosts" Name="tviHost" GotFocus="tviHost_GotFocus" LostFocus="tviHost_LostFocus" />
        </TreeView>
        <StatusBar Name="statusBar" Background="White" BorderBrush="Gray" BorderThickness="1" Grid.ColumnSpan="3" Margin="2,475,2,-10">
            <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="5" Width="765" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <StackPanel>
                        <TextBlock Name="txtMessage" TextWrapping="Wrap" FontWeight="SemiBold"/>
                </StackPanel>
            </ScrollViewer>
            <!--<Separator/>-->
            <!--<ProgressBar Name="progressBar" HorizontalAlignment="Stretch" Width="53" Height="30" Visibility="Hidden" HorizontalContentAlignment="Stretch"/>-->
        </StatusBar>
    </Grid>
</r:RibbonWindow>
